package com.wuba.rxjavademo.lyz.day0519;

import com.wuba.rxjavademo.lyz.BaseDemo;

import rx.Observable;
import rx.Observer;
import rx.Subscription;


/**
 * Created by liyaxing on 2016/6/2.
 */
public class Demo07 extends BaseDemo {

    public static void main(String[] ss){

        Subscription s = Observable.just(1,2,3,4).subscribe(observer) ;
        s.unsubscribe();
        Observable.just(5,6,7,8).subscribe(observer) ;



    }

    private static Observer observer = new Observer() {
        @Override
        public void onCompleted() {
            print("--onCompleted--");
        }
        @Override
        public void onError(Throwable e) {
            print("--onError--");
        }
        @Override
        public void onNext(Object o) {
            print("--onNext-- o = " + o);
        }
    } ;

}
